package cc.spider.fetcher;


import cc.spider.core.IFetcher;
import cc.spider.core.IFetcherListener;
import cc.spider.model.GlobalDefaultData;
import cc.spider.model.ResultInfo;
import cc.spider.model.TaskInfo;

public class SimpleFetcher implements IFetcher {
    @Override
    public void fetch(TaskInfo task, GlobalDefaultData globalDefaultData, IFetcherListener fetcherListener) {
        ResultInfo<String> response = new ResultInfo<>("empty fetcher, thread name is " + Thread.currentThread().getName());
        try {
            Thread.sleep(5000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        fetcherListener.success(task, response);
    }
}
